//
//  HWGameLiveFriendsListController.swift
//  PlayWithProject
//
//  Created by 王昌健 on 2021/11/16.
//

import UIKit
import JXSegmentedView
class HWGameLiveFriendsListController: HWBaseViewController {
    var tableView:UITableView!
    var tableViewProtocol = HWGameLiveFriendsListProtocol()
    override func viewDidLoad() {
        super.viewDidLoad()

        initUI()
        
        initFrame()
        
    }

}

extension HWGameLiveFriendsListController {
    private func initUI() -> Void {
        navigationView.isHidden = true
        view.backgroundColor = .clear
        
        tableView = UITableView.init(frame: CGRect.zero, style: UITableView.Style.plain)
        tableView.delegate = tableViewProtocol
        tableView.dataSource = tableViewProtocol
        tableView.backgroundColor = UIColor.colorWithHexString(hexString: "#FFFFFF")
        tableView.separatorStyle = .none
        tableView.rowHeight = UITableView.automaticDimension
        tableView.estimatedRowHeight = 40
        tableView.estimatedSectionHeaderHeight = 0
        tableView.estimatedSectionFooterHeight = 0
        tableView.showsVerticalScrollIndicator = false
        view.addSubview(tableView)
        tableView.contentInsetAdjustmentBehavior = .never
    }
    
    private func initFrame() -> Void {
        tableView.snp.makeConstraints { make in
            make.top.left.right.equalTo(0)
            if #available(iOS 11.0, *) {
                make.bottom.equalTo(self.view.safeAreaLayoutGuide.snp.bottom)
            }else{
                make.bottom.equalTo(0)
            }
        }
    }
}

extension HWGameLiveFriendsListController: JXSegmentedListContainerViewListDelegate {
    func listView() -> UIView {
        return view
    }
}
